// router.js
import {RouterMount,createRouter} from 'uni-simple-router';
import {underDevelopment} from "@/utils/utils.js"
const scrollInfo={};

const router = createRouter({
	platform: process.env.VUE_APP_PLATFORM,  
	routes: [...ROUTES],
	// h5:{
	// 	scrollBehavior:(to, from, savedPosition)=>{
	// 		const XY=scrollInfo[to.path];
	// 		if(XY){
	// 			return XY;
	// 		}
	// 		return savedPosition;
	// 	}
	// }
});
//全局路由前置守卫
router.beforeEach((to, from, next) => {
	// console.log('全局路由前置守卫',to.path, from)
	if(to.path==='/pages/hwz/hwz'|| to.path==="/pages/wbz/wbz"){
		underDevelopment()
		return
	}
	next();
});
// 全局路由后置守卫
router.afterEach((to, from) => {
    // console.log('全局路由后置守卫')
})

export {
	router,
	RouterMount
}